package com.daervin.svc.common.constants;

import java.util.Arrays;

/**
 * 操作来源
 *
 * @author daervin
 * @version 1.0.0
 * @since 1.0.0
 */
public enum SourceEnum {
    MANAGER(1, "管理后台"),
    APP(2, "手机端"),
    ;

    public int val;

    public String desc;

    SourceEnum(int val, String desc) {
        this.val = val;
        this.desc = desc;
    }

    public int getVal() {
        return val;
    }

    public String getDesc() {
        return desc;
    }

    public static SourceEnum valOf(Integer val) {
        return Arrays.stream(SourceEnum.values()).filter(k -> val != null && k.getVal() == val).findFirst().orElse(null);
    }
}
